package com.linkhub.oms.admin.modules.stock.service;

import com.linkhub.oms.admin.modules.stock.domain.dto.PassageStockDTO;
import com.linkhub.oms.admin.modules.stock.domain.dto.StockPreemptionResultDTO;
import com.linkhub.oms.admin.modules.stock.domain.param.StockFlowQueryParam;
import com.linkhub.oms.admin.modules.stock.domain.param.StockQueryParam;
import com.linkhub.oms.admin.modules.stock.domain.vo.StockFlowVO;
import com.linkhub.oms.admin.modules.stock.domain.vo.StockVO;
import com.linkhub.oms.common.response.PageDTO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @Description: StockBizService
 * @Author: echo
 * @Date: 2024/4/25 19:14
 * @Version: 1.0
 */
public interface StockBizService {

    /**
     * 分页查询库存列表接口
     *
     * @param stockQueryParam stockQueryParam
     * @return stocks
     */
    PageDTO<StockVO> pageStocks(StockQueryParam stockQueryParam);

    /**
     * 预占订单本地商品库存
     *
     * @param orderIds orderIds
     * @return 订单预占结果
     */
    List<StockPreemptionResultDTO> preemptOrderLocalProductStocks(List<String> orderIds);

    /**
     * 提货单状态变更为运输中时，新增提货单商品的在途库存
     *
     * @param passageStocks passageStocks
     */
    void incrementPassageStocks(List<PassageStockDTO> passageStocks);

    // 预占本地产品库存
    @Transactional(rollbackFor = Exception.class)
    boolean transactionPreemptOrderLocalProductStocks( Map<String, Integer> skuIdToNumsMap );

    List<Object> pickUpRecords(String pickUpNo);
}
